home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 15069 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: mayne.ugrad.cs.ubc.ca!not-for-mail
  2. From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Obtaining file lists in C?
  5. Date: 16 Apr 1996 13:52:08 -0700
  6. Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
  7. Message-ID: <4l119oINN8os@mayne.ugrad.cs.ubc.ca>
  8. References: <gcraig.1.001653A2@interaccess.com> <4ktll1$bk5@texas.nwlink.com>
  9. NNTP-Posting-Host: mayne.ugrad.cs.ubc.ca
  10.  
  11. In article <4ktll1$bk5@texas.nwlink.com>,
  12. Teresa Reiko  <tjr19@mail.nwlink.com> wrote:
  13.  >gcraig@interaccess.com (George Craig) wrote:
  14.  >>Could someone please tell me just one of the many ways I could implement an 
  15.  >>efficient file listing technique in standard ANSI or k&R c?
  16.  >
  17.  >This is impossible in standard C.  There is no standard C function to
  18.  >read the directories.  Most C implementations include one, however, so
  19.  >for instance in Borland C you can use findfirst and findnext, or you
  20.  >can use opendir, readdir, etc.
  21.  
  22. The latter are preferrable, because they are part of a standard, namely
  23. POSIX.1. They also have reentrant semantics (more than one directory reading
  24. stream can be created and stepped simultaneously).
  25. -- 
  26. I'm not really a jerk, but I play one on Usenet.
  27.